// File Name: oled_init.c
// Author: kukukukuku~
// Date: 2024-12-23

#include "apm32f00x_gpio.h"
#include "./OLED/inc/oled_init.h"
#include "./OLED/inc/oled_macros.h"

/**
 * @brief   OLED GPIO配置
 * @param   None
 * @retval  None
 * @note    静态
*/
static void oled_gpio_config(void)
{
    GPIO_Config_T gpioConfig = 
    {
        .pin   = OLED_SDA_GPIO_PIN,
        .mode  = GPIO_MODE_OUT_PP,
        .speed = GPIO_SPEED_10MHz,
        .intEn = GPIO_EINT_DISABLE,
    };
    
    //SDA
    GPIO_Config(OLED_SDA_GPIO_PORT, &gpioConfig);
    
    //SCL
    gpioConfig.pin = OLED_SCL_GPIO_PIN;
    GPIO_Config(OLED_SCL_GPIO_PORT, &gpioConfig);
}


/**
 * @brief   OLED初始化
 * @param   None
 * @retval  None
 * @note    None
*/
void oled_init(void)
{
    oled_gpio_config();
    
    OLED_SDA_H;
    OLED_SCL_H;
}
